package com.sjsm.sjsmscenerecord.holder;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

/**
 * Created by hasee on 2016/12/15.
 * 我爱敲代码!!!
 */



public abstract class BaseListHolder<T> {
    public View holderView;//注意：一开始就将convertView转移到holder中用一个变量表示
    public LayoutInflater inflater;
    public  Context context;
    public BaseListHolder(Context context){
        //1.初始化holderView
        inflater = LayoutInflater.from(context);
        holderView = initHolderView();//需要holderView
        //2.设置tag
        holderView.setTag(this);
    }
    /**
     * 初始化holderView
     * @return
     */
    public abstract View initHolderView();
    /**
     * 绑定数据
     */
    public abstract void bindData(T data);

    /**
     * 获取holderView
     * @return
     */
    public View getHolderView(){
        return holderView;
    }
}
